home *** CD-ROM | disk | FTP | other *** search
- on keyDown
- global gDirty
- set gDirty to 1
- if the key = TAB then
- if validatePDCScreen() then
- if the machineType = 256 then
- set the editableText of sprite 20 to 1
- hilite field "calories"
- else
- pass()
- end if
- end if
- else
- if the key = BACKSPACE then
- put EMPTY into field "meals"
- else
- if (charToNum(the key) > charToNum("3")) or (charToNum(the key) < charToNum("2")) then
- dontPassEvent()
- else
- if (length(the text of field "meals") >= 1) and (the selection = EMPTY) then
- dontPassEvent()
- else
- if (charToNum(the key) < charToNum("4")) or (charToNum(the key) > charToNum("1")) then
- pass()
- end if
- end if
- end if
- end if
- end if
- end
-
- on keyUp
- global calcdata
- if field "meals" = "2" then
- tell the stage
- doTwoMeals()
- end tell
- setaProp(calcdata, #twoMeals, 1)
- else
- if field "meals" = "3" then
- tell the stage
- doThreeMeals()
- end tell
- setaProp(calcdata, #twoMeals, 0)
- end if
- end if
- pass()
- end
-